/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.app.dal.entity;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.yanlight.util.JsonUtil;

/**
 * 
 * @author haolw
 * @time 2017/08/18
 */
public class GroupRole {
	private Integer id;
	private String name;
	private String roles;
	private Integer companyId;
	private Integer extId;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRoles() {
		return roles;
	}

	public void setRoles(String roles) {
		this.roles = roles;
	}

	public List<Integer> getRoleList() {
		if (StringUtils.isNotEmpty(roles)) {
			return JsonUtil.parseArray(roles, Integer.class);
		}
		return null;
	}

	public void setRoleList(List<Integer> roleList) {
		if (roleList != null && !roleList.isEmpty()) {
			this.roles = JsonUtil.toJson(roleList);
		}
	}

	public Integer getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}

	public Integer getExtId() {
		return extId;
	}

	public void setExtId(Integer extId) {
		this.extId = extId;
	}

}
